package test;

import java.util.Scanner;

public class 输出一个整数的每一位 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入数字：");
        int value = scan.nextInt();
        fun(value);
//        System.out.println(123456%10);
    }
    public static void fun(int num){//递归
        System.out.print(num%10 + " ");//低位到高位

        if(num>9){
            fun(num/10);
        }
        System.out.print(num%10 + " ");//高位到低位
    }


}
